<docs>
  ## 我的模块
</docs>
<template>
 <div>
  <div class="beijingtu"></div>
  <div class="bg_g">
    <!-- 头部 -->
    <div class="title">
        <label class="person" for="id_avatar">
          <img v-if="!imgShow" class="person" :src="imgSrc" alt>
          <img v-else="imgShow" src="~common/images/tx.png" alt/>
        </label>
      <div class="name clearfix">{{jbxx.xm}}</div>
    </div>
    <!-- 每个盒子 -->
    <div class="box1">
      <div class="box_option" @click="gotocvitae">
        <span>简历维护</span> <span class="_right">{{flag?'未完善':"修改"}}</span>
      </div>
      <div class="box_option" @click="link_jl()">
        <span>投递简历</span> <span class="_right">{{JL}}个</span>
      </div>
      <div class="box_option" style="margin-bottom:22px;" @click="link_gw()">
        <span>收藏岗位</span> <span class="_right">{{GW}}家</span>
      </div>
    </div>
    <div class="bottom"></div>
  </div>
  </div>
</template>
<script>
import $ from "@/common/js/axios";

export default {
  data() {
    return {
      GW:"0",
      JL:"0",
      imgSrc:'',
      imgSrcName:"",
      imgShow: true,
      flag:true,
      jbxx:{}
    };
  },
  computed: {},
  methods: {
    gotocvitae(){
      this.$router.push({path:"cvitae"});
    },
    link_jl(){
      if(this.JL != 0){
        this.$router.push({name:'tdlist'});
      }else if (this.JL == 0){
        this.$alert({
          type:"warning",
          message: '您还未投递简历！'
        })
      }
    },
    link_gw(){
      if(this.GW != 0){
        this.$router.push({name:'gwlist'});
      }else if (this.GW == 0){
        this.$alert({
          type:"warning",
          message: '您还未收藏岗位！'
        })
      }
    },
    GET_user(){
      this.$loading = true;
      $.get("/wdjl/jlxxCx")
      .then(res => {
        const data = res.returnData.jlxx;
        // this.$store.commit('setUser',data);
        this.jbxx = data.jbxx;
         this.imgSrcName = data.jbxx.txurl
            if (this.imgSrcName) {
              this.imgSrc = conf.urlPrefix+'/sysfiles/tx/'+this.imgSrcName;
              this.imgShow = false;
            }
        // 判断修改，完善文字----开始
        if(data.qzyx&&data.zwpj&&data.gzjl.length&&data.pxjl.length&&data.yynl.length){
          this.flag= false;
        }
        // 无查询结果
        if (+data.executeResult === 1) {
          this.imgSrcName = data.txurl;
          if (this.imgSrc) {
            this.imgSrc = conf.urlPrefix+'/sysfiles/tx/'+this.imgSrcName;
            this.imgShow = false;
          }
        }
      })
      .finally(() => {
        this.$loading = false;
      });
    },
    GET_num(){
      this.$loading = true;
      $.get("/rmgw/tdsctsCx")
      .then(res => {
        const data = res.returnData;
        if (+data.executeResult === 1) {
          this.GW = data.slxx.scgwsl ? data.slxx.scgwsl: '-';
          this.JL = data.slxx.tdjlsl ? data.slxx.tdjlsl: '-';
        }
      })
      .finally(() => {
        this.$loading = false;
      });
    }
  },
  created() {
    // 获取岗位数量
    this.GET_num();
    this.GET_user();
  }
};
</script>
<style scoped lang="scss">
@import "~common/scss/var.scss";
    img{
  width:100%;
  height:100%;
}
.bg_g{
  padding:0 34px;
  overflow: hidden;
  position:relative;
}
body {
  overflow: hidden;
}
.beijingtu {
  width: 100%;
  height: 880px;
  background: url("../../common/images/beijing.png") no-repeat;
  background-size: 100% 100%;
  position: absolute;
  z-index: -9000;
  margin-top: -210px;
}
.h100 {
  height: 0.8rem;
}
.bottom {
  width: 100%;
  height: 190px;
  background: url("../../common/images/dbg.png") no-repeat;
  background-size: 100%;
  position: fixed;
  bottom:0;
}
.box_option::after {
  content: " ";
  display: inline-block;
  height: 0.2rem;
  width: 0.2rem;
  border-width: 0.02667rem 0.02667rem 0 0;
  border-color: #555;
  border-style: solid;
  -webkit-transform: matrix(0.71, 0.71, -0.71, 0.71, 0, 0);
  -ms-transform: matrix(0.71, 0.71, -0.71, 0.71, 0, 0);
  transform: matrix(0.71, 0.71, -0.71, 0.71, 0, 0);
  position: absolute;
  right: 0;
  top:20%;
}
.title {
  margin-top: 0.88rem;
  .person {
    display: block;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    margin: auto;
    margin-bottom: 0.5rem;

  }
  .name {
    display: flex;
    justify-content: center;
    font-size: 32px;
    margin-bottom: 0.88rem;
    color: white;
    font-weight:bold;
    height:32px;
  }
}
.box1 {
  // padding:20px 0;
  margin:40px auto;
  background: white;
  overflow: hidden;
  border-radius: 4px;
  line-height: 24px;
  .box_option {
      line-height: 0.4rem;
    margin: 50px 0.45333rem 0.45333rem 0.45333rem;
    position: relative;
    color: #333333;
    ._right{
      float:right;
      margin-right:$padding/2*4;
      font-size:$font-size-small;
      color:$color-base;
    }
  }
  .box_option span {
    font-weight: bold;
  }
  .box_option_left {
    float: left;
  }
  .box_option_right {
    float: right;
  }
}
/* p{
     width: 2rem;
    height: 2rem;
    margin-left: 25px;
    float:left;
  }
  p:first-child{
    background-color:steelblue;
  }
  p:nth-child(2){
    background-color:#652BF5;
  }
  p:last-child{
     background-color:red;
  } */
</style>
